Skip to content

WithPropertyHeader: extract data by header text instead of column name#5

Open
imil wants to merge 1 commit intoipvalverde:masterfrom
imil:master
Open

WithPropertyHeader: extract data by header text instead of column name#5
imil wants to merge 1 commit intoipvalverde:masterfrom
imil:master

Conversation

@imil
Copy link

@imil imil commented Mar 1, 2018

A feature that was convenient to me, and might be useful for others:
Instead of searching for the property by column name, search by the header text.
Example:

| A | B
1| Product | Price
2| Tea | 0.9
3| Coffee | 1.5

Instead of writing
.WithProperty(p=>p.Price, "B")
it will be possible to write
.WithHeaderRow(1) //Optional: 1 by default
.WithPropertyHeader(p => p.Price, "Price")

Then, if another column gets inserted after A, moving Price to column C, no code modification will be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant